package com.itheima.service.impl;

import com.itheima.dao.CheckgroupDao;
import com.itheima.dao.CheckitemDao;
import com.itheima.service.CheckitemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class CheckitemServiceImpl implements CheckitemService {
    @Autowired
    CheckitemDao checkitemDao;

    @Autowired
    CheckgroupDao checkgroupDao;

    @Override
    public Boolean saveDelete(Integer id) {
        if (checkgroupDao.selectByItemId(id)!=0) {
            return false;
        }
        checkitemDao.delete(id);
        return true;
    }
}
